<html>
<head><meta charset="utf-8"><title>exhaustiveness is broken #79048 · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html">exhaustiveness is broken #79048</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="216744730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216744730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216744730">(Nov 14 2020 at 19:09)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="245339">@Nadrieril</span> let's move the discussion to chat?</p>



<a name="216744783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216744783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216744783">(Nov 14 2020 at 19:10)</a>:</h4>
<p>I guess we should fine a minimal fix for beta backporting, and in case that is not a nice fix that we want to keep around, then do a good fix</p>



<a name="216744795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216744795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216744795">(Nov 14 2020 at 19:11)</a>:</h4>
<p>(I think the beta cutoff was yesterday, so it will be in beta)</p>



<a name="216744904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216744904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216744904">(Nov 14 2020 at 19:14)</a>:</h4>
<p>Yep, beta has been cut; we'll definitely want a backport</p>



<a name="216744921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216744921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216744921">(Nov 14 2020 at 19:15)</a>:</h4>
<p>The issue should be <code>regression-from-stable-to-beta</code> then?</p>



<a name="216744971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216744971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216744971">(Nov 14 2020 at 19:16)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/ef663a8a48ea6b98b43cbfaefd99316b36b16825/compiler/rustc_typeck/src/check/writeback.rs#L34">https://github.com/rust-lang/rust/blob/ef663a8a48ea6b98b43cbfaefd99316b36b16825/compiler/rustc_typeck/src/check/writeback.rs#L34</a> is where the <code>TypeckResults</code> are built. So we can add a <code>FxHashSet&lt;NodeId&gt;</code> to <code>FnCtxt</code>, populate that during type checking and move it just like we do with <a href="https://github.com/rust-lang/rust/blob/ef663a8a48ea6b98b43cbfaefd99316b36b16825/compiler/rustc_typeck/src/check/writeback.rs#L73">https://github.com/rust-lang/rust/blob/ef663a8a48ea6b98b43cbfaefd99316b36b16825/compiler/rustc_typeck/src/check/writeback.rs#L73</a></p>



<a name="216744974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216744974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216744974">(Nov 14 2020 at 19:16)</a>:</h4>
<p>Ah, yes, but don't bump that just yet. I'll update labels after we release for easier tracking.</p>



<a name="216744989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216744989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216744989">(Nov 14 2020 at 19:17)</a>:</h4>
<p>Then <code>const_to_pat</code> can use the expression's node id to index the hashset (which it gets via <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.typeck_body">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.typeck_body</a>)</p>



<a name="216745034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216745034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nadrieril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216745034">(Nov 14 2020 at 19:18)</a>:</h4>
<p>On the side of code that I understand, I think if we pass the scrutinee type to <code>is_useful</code> and only inspect that instead of the type of patterns, this would solve the issue. However we'd run into <a href="https://github.com/rust-lang/rust/issues/72476">https://github.com/rust-lang/rust/issues/72476</a> again and I don't know how to fix that one</p>



<a name="216745037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216745037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nadrieril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216745037">(Nov 14 2020 at 19:18)</a>:</h4>
<p>What you're proposing sounds easier</p>



<a name="216745121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216745121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216745121">(Nov 14 2020 at 19:21)</a>:</h4>
<p>ok, I'll implement my solution then along with the appropriate tests. We can then get that backported and iterate on cleaning this up without any pressure</p>



<a name="216748418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216748418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216748418">(Nov 14 2020 at 20:32)</a>:</h4>
<p>Hmm... <a href="https://github.com/rust-lang/rust/compare/master...oli-obk:byte_str_pat?expand=1">this</a> does not appear to work at all</p>



<a name="216748550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216748550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216748550">(Nov 14 2020 at 20:35)</a>:</h4>
<p>I'll try to find some time tomorrow to look at it again</p>



<a name="216752296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216752296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216752296">(Nov 14 2020 at 21:52)</a>:</h4>
<p>(I assigned you to the issue for easier tracking/agenda preparation)</p>



<a name="216752434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216752434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nadrieril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216752434">(Nov 14 2020 at 21:54)</a>:</h4>
<p>I don't know the tck code, but I imagine the ideal solution would be to give any <code>b"foo"</code> pattern an inference variable as a type, and have inference figure out the type it should have. Is that an easy thing to do, compared to the other solutions we have?</p>



<a name="216752549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216752549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216752549">(Nov 14 2020 at 21:56)</a>:</h4>
<p>If I can be really annoying for a second, 'tck' as an abbreviation for 'type checking' is really hard to decipher for new contributors - do you mind saying 'typeck' or something instead? that pulls up <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/fn.typeck.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/fn.typeck.html</a> as the first hit on google</p>



<a name="216752571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216752571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216752571">(Nov 14 2020 at 21:57)</a>:</h4>
<p>(and from there people can figure it out, I'm not asking you to write a paragraph every time)</p>



<a name="216752624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216752624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216752624">(Nov 14 2020 at 21:58)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048/near/216752549">said</a>:</p>
<blockquote>
<p>that pulls up <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/fn.typeck.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/fn.typeck.html</a> as the first hit on google</p>
</blockquote>
<p>As Google search results are personal, I guess this could not be the case for a new contributor?</p>



<a name="216752627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216752627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216752627">(Nov 14 2020 at 21:59)</a>:</h4>
<p>ah hmm</p>



<a name="216752629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216752629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216752629">(Nov 14 2020 at 21:59)</a>:</h4>
<p>Also maybe if "tck" is used by some people here we can add it to the glossary</p>



<a name="216752634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216752634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216752634">(Nov 14 2020 at 21:59)</a>:</h4>
<p>sure, that works too</p>



<a name="216752639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216752639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216752639">(Nov 14 2020 at 21:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="255061">Léo Lanteri Thauvin</span> <a href="#narrow/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048/near/216752624">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048/near/216752549">said</a>:</p>
<blockquote>
<p>that pulls up <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/fn.typeck.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/fn.typeck.html</a> as the first hit on google</p>
</blockquote>
<p>As Google search results are personal, I guess this could not be the case for a new contributor?</p>
</blockquote>
<p>I tried a new private tab and it had the same results, not sure if google does IP tracking though</p>



<a name="216752765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216752765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216752765">(Nov 14 2020 at 22:02)</a>:</h4>
<p>Heh, I wanted to try but Firefox crashed when I asked it to go on Google <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="216752898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216752898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216752898">(Nov 14 2020 at 22:07)</a>:</h4>
<p>typeck fails completely to find something Rust-related for me on DuckDuckGo</p>



<a name="216752955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216752955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216752955">(Nov 14 2020 at 22:08)</a>:</h4>
<p>does 'rust typeck' bring something up?</p>



<a name="216752959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216752959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216752959">(Nov 14 2020 at 22:08)</a>:</h4>
<p>'rust tck' gives me nothing <a href="/user_uploads/4715/LR__BM37hqKcmXzEwhuwBxBV/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/LR__BM37hqKcmXzEwhuwBxBV/image.png" title="image.png"><img src="/user_uploads/4715/LR__BM37hqKcmXzEwhuwBxBV/image.png"></a></div>



<a name="216753103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216753103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nadrieril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216753103">(Nov 14 2020 at 22:12)</a>:</h4>
<p>Oops sorry. I'm not even a hardened contributor x)</p>



<a name="216753118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216753118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216753118">(Nov 14 2020 at 22:13)</a>:</h4>
<p>oh no worries, I know it's just less to type <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="216753129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216753129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216753129">(Nov 14 2020 at 22:13)</a>:</h4>
<p>« Rust typeck » works perfectly so that’s good enough <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="216790183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216790183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216790183">(Nov 15 2020 at 12:39)</a>:</h4>
<p><span class="user-mention silent" data-user-id="245339">Nadrieril</span> <a href="#narrow/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048/near/216752434">said</a>:</p>
<blockquote>
<p>I don't know the tck code, but I imagine the ideal solution would be to give any <code>b"foo"</code> pattern an inference variable as a type, and have inference figure out the type it should have. Is that an easy thing to do, compared to the other solutions we have?</p>
</blockquote>
<p>ah, while we can try this, you gave me another idea. We can make sure that the literal -&gt; ty::Const conversion figures out the correct type</p>



<a name="216791581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216791581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216791581">(Nov 15 2020 at 13:05)</a>:</h4>
<p>ah nevermind, a fix PR is now up: <a href="https://github.com/rust-lang/rust/pull/79072">https://github.com/rust-lang/rust/pull/79072</a></p>



<a name="216791626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216791626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216791626">(Nov 15 2020 at 13:06)</a>:</h4>
<p>the problem was/is that <code>TypeckResults</code> is not taken verbatim out out of the type checker, but instead all fields that should be taken must be taken manually <span aria-label="confused" class="emoji emoji-1f615" role="img" title="confused">:confused:</span></p>



<a name="216795229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216795229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nadrieril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216795229">(Nov 15 2020 at 14:29)</a>:</h4>
<p>@oli, what's this <code>#[instrument(skip(self))]</code> magic you use? I can't find it in the dev guide or the docs</p>



<a name="216796116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216796116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216796116">(Nov 15 2020 at 14:44)</a>:</h4>
<p><span class="user-mention" data-user-id="245339">@Nadrieril</span>  I think it is <a href="https://docs.rs/tracing-attributes/0.1.11/tracing_attributes/attr.instrument.html">https://docs.rs/tracing-attributes/0.1.11/tracing_attributes/attr.instrument.html</a></p>



<a name="216796498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216796498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216796498">(Nov 15 2020 at 14:51)</a>:</h4>
<p>jup, that's it</p>



<a name="216796516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216796516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216796516">(Nov 15 2020 at 14:51)</a>:</h4>
<p>Using it instead of just <code>debug!</code> invocations will give us a hierarchical tree in the logs, making it much easier to see which logs are nested below others</p>



<a name="216796590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216796590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nadrieril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216796590">(Nov 15 2020 at 14:52)</a>:</h4>
<p>ohh sounds amazing</p>



<a name="216796862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216796862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216796862">(Nov 15 2020 at 14:57)</a>:</h4>
<p>jup, it made finding this bug much easier <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span> thus the "unrelated" logging changes</p>



<a name="216801102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/216801102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nadrieril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#216801102">(Nov 15 2020 at 16:37)</a>:</h4>
<p>PR looks good, as far as I can understand it <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="219575375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/219575375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#219575375">(Dec 11 2020 at 08:19)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> here is the discussion on the exhaustivness soundness bug (cc <a href="#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bweekly.20meeting.5D.202020-12-10.20.2354818/near/219485251">https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bweekly.20meeting.5D.202020-12-10.20.2354818/near/219485251</a>). The solution we came up with seemed like the right one, even though I agree that looking at just the solution it seems like a band-aid.</p>



<a name="219575576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/219575576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#219575576">(Dec 11 2020 at 08:21)</a>:</h4>
<p>though we did recognize that a refactor of all of this logic is probably necessary <em>anyway</em>. Potentially all of this will beocme simpler once we move to value trees for type-level constants</p>



<a name="219590135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/219590135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#219590135">(Dec 11 2020 at 10:58)</a>:</h4>
<p>I trust you on that, <span class="user-mention" data-user-id="124288">@oli</span> :)</p>



<a name="219590151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/exhaustiveness%20is%20broken%20%2379048/near/219590151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/exhaustiveness.20is.20broken.20.2379048.html#219590151">(Dec 11 2020 at 10:58)</a>:</h4>
<p>(I don't have time to read the discussion in detail right now)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>